diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-09-06 22:30:23 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-09-06 22:30:23 -0400 |
commit | 9366bb0996cd7c8d3f77ee45f84ddd77f7ded8b7 (patch) | |
tree | 4045c199c0a7c5aa32a106110f2defd032196e86 /setuptools/tests/test_setuptools.py | |
parent | 595ed8baab48541dd1bbb2c6907c5463305b646b (diff) | |
download | external_python_setuptools-9366bb0996cd7c8d3f77ee45f84ddd77f7ded8b7.tar.gz external_python_setuptools-9366bb0996cd7c8d3f77ee45f84ddd77f7ded8b7.tar.bz2 external_python_setuptools-9366bb0996cd7c8d3f77ee45f84ddd77f7ded8b7.zip |
Add tests capturing expected behavior, including failure to match expectation indicated in docstring.
Diffstat (limited to 'setuptools/tests/test_setuptools.py')
-rw-r--r-- | setuptools/tests/test_setuptools.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/setuptools/tests/test_setuptools.py b/setuptools/tests/test_setuptools.py new file mode 100644 index 00000000..f6bec644 --- /dev/null +++ b/setuptools/tests/test_setuptools.py @@ -0,0 +1,24 @@ +import pytest + +import setuptools + + +@pytest.fixture +def example_source(tmpdir): + tmpdir.mkdir('foo') + (tmpdir / 'foo/bar.py').write('') + (tmpdir / 'readme.txt').write('') + return tmpdir + + +def test_findall(example_source): + found = list(setuptools.findall(str(example_source))) + expected = ['readme.txt', 'foo/bar.py'] + assert found == expected + + +def test_findall_curdir(example_source): + with example_source.as_cwd(): + found = list(setuptools.findall()) + expected = ['readme.txt', 'foo/bar.py'] + assert found == expected |