aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_egg_info.py
diff options
context:
space:
mode:
authorShashank Singh <shashanksingh28@gmail.com>2018-10-28 12:47:00 -0400
committerPaul Ganssle <paul@ganssle.io>2018-11-02 20:30:11 -0400
commitd3e08a321065f9c84ac923417f9d80ae510adaaf (patch)
treeb4e4f869871e405080f0c19f3c5ea278fb475110 /setuptools/tests/test_egg_info.py
parent6ed6fe8def487aa77ee67d5ab3adcb2b66814831 (diff)
downloadexternal_python_setuptools-d3e08a321065f9c84ac923417f9d80ae510adaaf.tar.gz
external_python_setuptools-d3e08a321065f9c84ac923417f9d80ae510adaaf.tar.bz2
external_python_setuptools-d3e08a321065f9c84ac923417f9d80ae510adaaf.zip
Add tests for setup.py inclusion
This tests that `setup.py` is included by default in the distribution with the egg_info command and when an sdist is built with build_meta.build_sdist
Diffstat (limited to 'setuptools/tests/test_egg_info.py')
-rw-r--r--setuptools/tests/test_egg_info.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 46fb884f..f97b3f1d 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -569,6 +569,20 @@ class TestEggInfo:
for msg in fixtures:
assert manifest_maker._should_suppress_warning(msg)
+ def test_egg_info_includes_setup_py(self, tmpdir_cwd):
+ self._create_project()
+ dist = Distribution({"name": "foo", "version": "0.0.1"})
+ dist.script_name = "non_setup.py"
+ egg_info_instance = egg_info(dist)
+ egg_info_instance.finalize_options()
+ egg_info_instance.run()
+
+ assert 'setup.py' in egg_info_instance.filelist.files
+
+ with open(egg_info_instance.egg_info + "/SOURCES.txt") as f:
+ sources = f.read().split('\n')
+ assert 'setup.py' in sources
+
def _run_egg_info_command(self, tmpdir_cwd, env, cmd=None, output=None):
environ = os.environ.copy().update(
HOME=env.paths['home'],
@@ -605,4 +619,4 @@ class TestEggInfo:
assert 'Version: 0.0.0.dev0' in pkg_info_lines
def test_get_pkg_info_revision_deprecated(self):
- pytest.warns(EggInfoDeprecationWarning, get_pkg_info_revision) \ No newline at end of file
+ pytest.warns(EggInfoDeprecationWarning, get_pkg_info_revision)