File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1818import pathlib
1919
2020TESTS_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" )
2526
2627
2728@contextlib .contextmanager
Original file line number Diff line number Diff line change 1818import pretend
1919import pytest
2020
21+ from tests import helpers
2122from twine .commands import check
2223
2324
@@ -283,6 +284,21 @@ def test_main(monkeypatch):
283284 assert check_stub .calls == [pretend .call (["dist/*" ], strict = False )]
284285
285286
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+
286302# TODO: Test print() color output
287303
288304# TODO: Test log formatting
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ def check(
127127 :return:
128128 ``True`` if there are rendering errors, otherwise ``False``.
129129 """
130+ dists = commands ._find_dists (dists )
130131 uploads , _ , _ = commands ._split_inputs (dists )
131132 if not uploads : # Return early, if there are no files to check.
132133 logger .error ("No files to check." )
You can’t perform that action at this time.
0 commit comments