test_build.py 798 B

123456789101112131415161718192021222324252627282930313233
  1. from setuptools import Command
  2. from setuptools.command.build import build
  3. from setuptools.dist import Distribution
  4. def test_distribution_gives_setuptools_build_obj(tmpdir_cwd):
  5. """
  6. Check that the setuptools Distribution uses the
  7. setuptools specific build object.
  8. """
  9. dist = Distribution(
  10. dict(
  11. script_name='setup.py',
  12. script_args=['build'],
  13. packages=[],
  14. package_data={'': ['path/*']},
  15. )
  16. )
  17. assert isinstance(dist.get_command_obj("build"), build)
  18. class Subcommand(Command):
  19. """Dummy command to be used in tests"""
  20. def initialize_options(self):
  21. pass
  22. def finalize_options(self):
  23. pass
  24. def run(self):
  25. raise NotImplementedError("just to check if the command runs")