diff options
author | Shashank Singh <shashanksingh28@gmail.com> | 2018-10-28 12:47:00 -0400 |
---|---|---|
committer | Paul Ganssle <paul@ganssle.io> | 2018-11-02 20:30:11 -0400 |
commit | d3e08a321065f9c84ac923417f9d80ae510adaaf (patch) | |
tree | b4e4f869871e405080f0c19f3c5ea278fb475110 /setuptools/tests/test_build_meta.py | |
parent | 6ed6fe8def487aa77ee67d5ab3adcb2b66814831 (diff) | |
download | external_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_build_meta.py')
-rw-r--r-- | setuptools/tests/test_build_meta.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index c5f4dcaa..82a5511c 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -2,9 +2,11 @@ from __future__ import unicode_literals import os import shutil +import tarfile import pytest +from setuptools.build_meta import build_sdist from .files import build_files from .textwrap import DALS from . import py2_only @@ -181,3 +183,13 @@ def test_build_sdist_version_change(build_backend): sdist_name = build_backend.build_sdist("out_sdist") assert os.path.isfile(os.path.join(os.path.abspath("out_sdist"), sdist_name)) + + +def test_build_sdist_setup_py_exists(tmpdir_cwd): + # If build_sdist is called from a script other than setup.py, + # ensure setup.py is include + build_files(defns[0]) + targz_path = build_sdist("temp") + with tarfile.open(os.path.join("temp", targz_path)) as tar: + assert any('setup.py' in name for name in tar.getnames()) + |