mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #21918: Convert test_tools.py to a sub-package of test.
This commit is contained in:
parent
52b2bc0369
commit
2b0a610297
10 changed files with 283 additions and 195 deletions
34
Lib/test/test_tools/test_pdeps.py
Normal file
34
Lib/test/test_tools/test_pdeps.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"""Tests for the pdeps script in the Tools directory."""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
import tempfile
|
||||
from test import support
|
||||
|
||||
from test.test_tools import scriptsdir, skip_if_missing, import_tool
|
||||
|
||||
skip_if_missing()
|
||||
|
||||
|
||||
class PdepsTests(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(self):
|
||||
self.pdeps = import_tool('pdeps')
|
||||
|
||||
def test_process_errors(self):
|
||||
# Issue #14492: m_import.match(line) can be None.
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
fn = os.path.join(tmpdir, 'foo')
|
||||
with open(fn, 'w') as stream:
|
||||
stream.write("#!/this/will/fail")
|
||||
self.pdeps.process(fn, {})
|
||||
|
||||
def test_inverse_attribute_error(self):
|
||||
# Issue #14492: this used to fail with an AttributeError.
|
||||
self.pdeps.inverse({'a': []})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue