Skip to content

Commit a608d48

Browse files
committed
ArgSuite: enter empty directory
1 parent 83b6c85 commit a608d48

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

mypy/options.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __init__(self) -> None:
131131
self.scripts_are_modules = False
132132

133133
# Config file name
134-
self.config_file = 'setup.cfg' # type: Optional[str]
134+
self.config_file = None # type: Optional[str]
135135

136136
# Write junit.xml to given file
137137
self.junit_xml = None # type: Optional[str]

mypy/test/testargs.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
from mypy.test.helpers import Suite, assert_equal
99
from mypy.options import Options
1010
from mypy.main import process_options
11+
import tempfile
12+
import os
1113

1214

1315
class ArgSuite(Suite):
1416
def test_coherence(self) -> None:
15-
options = Options()
16-
_, parsed_options = process_options([], require_targets=False)
17-
assert_equal(options, parsed_options)
17+
with tempfile.TemporaryDirectory(prefix='mypy-test-') as tmpdir:
18+
# Enter directory to avoid finding 'setup.cfg'
19+
os.chdir(tmpdir)
20+
options = Options()
21+
_, parsed_options = process_options([], require_targets=False)
22+
assert_equal(options, parsed_options)

0 commit comments

Comments
 (0)