test_build_py.py 669 B

12345678910111213141516171819202122232425262728293031
  1. import os
  2. import pytest
  3. from setuptools.dist import Distribution
  4. @pytest.yield_fixture
  5. def tmpdir_as_cwd(tmpdir):
  6. with tmpdir.as_cwd():
  7. yield tmpdir
  8. def test_directories_in_package_data_glob(tmpdir_as_cwd):
  9. """
  10. Directories matching the glob in package_data should
  11. not be included in the package data.
  12. Regression test for #261.
  13. """
  14. dist = Distribution(dict(
  15. script_name='setup.py',
  16. script_args=['build_py'],
  17. packages=[''],
  18. name='foo',
  19. package_data={'': ['path/*']},
  20. ))
  21. os.makedirs('path/subpath')
  22. #with contexts.quiet():
  23. dist.parse_command_line()
  24. dist.run_commands()