File tree Expand file tree Collapse file tree 6 files changed +93
-1
lines changed Expand file tree Collapse file tree 6 files changed +93
-1
lines changed Original file line number Diff line number Diff line change 4848 git clone --recurse-submodules https://github.com/adafruit/CircuitPython_Community_Bundle.git
4949 cd CircuitPython_Community_Bundle
5050 circuitpython-build-bundles --filename_prefix test-bundle --library_location libraries --library_depth 2
51+ - name : Munge tests
52+ run : pytest
5153 - name : Build Python package
5254 run : |
5355 pip install --upgrade setuptools wheel twine readme_renderer testresources
Original file line number Diff line number Diff line change @@ -10,3 +10,4 @@ version.py
1010.env /*
1111.DS_Store
1212.idea /*
13+ testcases /* .out
Original file line number Diff line number Diff line change 11Click
2+ pytest
23requests
34semver
4- wheel
55tomli ; python_version < "3.11"
6+ wheel
Original file line number Diff line number Diff line change 1+
2+
3+
4+
5+ if 1:
6+ pass
7+
8+
9+
10+ if 1:
11+ pass
12+
13+
14+
15+
16+ if 1:
17+ pass
18+
19+
20+
21+ if 1:
22+ pass
23+
24+ __version__ = "1.2.3"
25+
26+ if 1:
27+ print("is circuitpython")
28+
29+ if 0:
30+ print("not circuitpython (1)")
31+
32+ if 0:
33+ print("not circuitpython (2)")
Original file line number Diff line number Diff line change 1+ from __future__ import annotation
2+
3+ try :
4+ from typing import TYPE_CHECKING
5+ except ImportError :
6+ pass
7+
8+ try :
9+ from typing import TYPE_CHECKING as T
10+ except ImportError :
11+ pass
12+
13+
14+ try :
15+ import typing
16+ except :
17+ pass
18+
19+ try :
20+ import typing as T
21+ except :
22+ pass
23+
24+ __version__ = "0.0.0-auto"
25+
26+ if sys .implementation .name == "circuitpython" :
27+ print ("is circuitpython" )
28+
29+ if sys .implementation .name != "circuitpython" :
30+ print ("not circuitpython (1)" )
31+
32+ if not sys .implementation .name == "circuitpython" :
33+ print ("not circuitpython (2)" )
Original file line number Diff line number Diff line change 1+ import sys , pathlib
2+ import pytest
3+
4+ top = pathlib .Path (__file__ ).parent .parent
5+ sys .path .insert (0 , str (top ))
6+
7+ from circuitpython_build_tools .munge import munge
8+
9+ @pytest .mark .parametrize ("test_path" , top .glob ("testcases/*.py" ))
10+ def test_munge (test_path ):
11+ result_path = test_path .with_suffix (".out" )
12+ result_path .unlink (missing_ok = True )
13+
14+ result_content = munge (test_path , "1.2.3" )
15+ result_path .write_text (result_content , encoding = "utf-8" )
16+
17+ expected = test_path .with_suffix (".exp" )
18+ expected_content = expected .read_text (encoding = "utf-8" )
19+
20+ assert result == expected
21+
22+ result_path .unlink ()
You can’t perform that action at this time.
0 commit comments