File tree 3 files changed +22
-4
lines changed
3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 18
18
import pathlib
19
19
20
20
TESTS_DIR = pathlib .Path (__file__ ).parent
21
- SDIST_FIXTURE = os .path .join (TESTS_DIR , "fixtures/twine-1.5.0.tar.gz" )
22
- WHEEL_FIXTURE = os .path .join (TESTS_DIR , "fixtures/twine-1.5.0-py2.py3-none-any.whl" )
23
- NEW_SDIST_FIXTURE = os .path .join (TESTS_DIR , "fixtures/twine-1.6.5.tar.gz" )
24
- NEW_WHEEL_FIXTURE = os .path .join (TESTS_DIR , "fixtures/twine-1.6.5-py2.py3-none-any.whl" )
21
+ FIXTURES_DIR = os .path .join (TESTS_DIR , "fixtures" )
22
+ SDIST_FIXTURE = os .path .join (FIXTURES_DIR , "twine-1.5.0.tar.gz" )
23
+ WHEEL_FIXTURE = os .path .join (FIXTURES_DIR , "twine-1.5.0-py2.py3-none-any.whl" )
24
+ NEW_SDIST_FIXTURE = os .path .join (FIXTURES_DIR , "twine-1.6.5.tar.gz" )
25
+ NEW_WHEEL_FIXTURE = os .path .join (FIXTURES_DIR , "twine-1.6.5-py2.py3-none-any.whl" )
25
26
26
27
27
28
@contextlib .contextmanager
Original file line number Diff line number Diff line change 18
18
import pretend
19
19
import pytest
20
20
21
+ from tests import helpers
21
22
from twine .commands import check
22
23
23
24
@@ -283,6 +284,21 @@ def test_main(monkeypatch):
283
284
assert check_stub .calls == [pretend .call (["dist/*" ], strict = False )]
284
285
285
286
287
+ def test_check_expands_glob (monkeypatch ):
288
+ """Regression test for #1187."""
289
+ warning_stream = pretend .stub ()
290
+ warning_stream_cls = pretend .call_recorder (lambda : warning_stream )
291
+ monkeypatch .setattr (check , "_WarningStream" , warning_stream_cls )
292
+
293
+ check_file = pretend .call_recorder (lambda fn , stream : ([], True ))
294
+ monkeypatch .setattr (check , "_check_file" , check_file )
295
+
296
+ assert not check .main ([f"{ helpers .FIXTURES_DIR } /*" ])
297
+
298
+ # check_file is called more than once, indicating the glob has been expanded
299
+ assert len (check_file .calls ) > 1
300
+
301
+
286
302
# TODO: Test print() color output
287
303
288
304
# TODO: Test log formatting
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ def check(
127
127
:return:
128
128
``True`` if there are rendering errors, otherwise ``False``.
129
129
"""
130
+ dists = commands ._find_dists (dists )
130
131
uploads , _ , _ = commands ._split_inputs (dists )
131
132
if not uploads : # Return early, if there are no files to check.
132
133
logger .error ("No files to check." )
You can’t perform that action at this time.
0 commit comments