Skip to content

Commit 7f969e1

Browse files
committed
zero deps
1 parent b92ded6 commit 7f969e1

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

.github/workflows/python-test.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,25 @@ jobs:
2424
version: "latest"
2525
python-version: ${{ matrix.python-version }}
2626

27-
- name: Install & Test
27+
- name: Install & Test Defaults
2828
run: |
29-
uv pip install ".[test,extras]"
30-
pytest --cov=doorway tests/
29+
uv pip install ".[test]"
30+
pytest --cov=doorway --color=yes --capture=no --verbose -m 'not extra_test' ./tests/
31+
32+
- name: Install & Test Extras
33+
run: |
34+
uv pip install ".[extras]"
35+
pytest --cov=doorway --color=yes --capture=no --verbose -m 'not extra_test' ./tests/
3136
3237
# codecov automatically merges all generated files
3338
- uses: codecov/codecov-action@v1
3439
with:
3540
token: ${{ secrets.CODECOV_TOKEN }}
3641
fail_ci_if_error: false
42+
43+
44+
# # @pytest.mark.remote_test
45+
# # pytest --color=yes --capture=no --verbose -m 'not remote_test'
46+
# # * run pytest on non-remote tests
47+
# - id: pytest
48+
# run: pytest --color=yes --capture=no --verbose -m 'not remote_test'

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ test = [
4646
"pytest-cov>=2",
4747
]
4848

49-
extra = [
49+
extras = [
5050
"rfc3986>=1",
5151
"requests",
5252
"cachier",

pytest.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11

22
[pytest]
33
minversion = 6.0
4+
45
testpaths =
56
tests
67
doorway
8+
79
python_files =
810
test.py
911
test_*.py
1012
__test__*.py
13+
14+
; usage:
15+
; * annotation: `@pytest.mark.extra_test`
16+
; * skip tests: `pytest --color=yes --capture=no --verbose -m 'not extra_test'`
17+
markers =
18+
basic_test: tests that are dependent on default dependencies
19+
extra_test: tests that are dependent on any extra dependencies

tests/test_uri.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,15 @@
2424

2525
import pytest
2626

27-
from doorway.x._uri import UriMalformedException
28-
from doorway.x._uri import UriTypeEnum
29-
from doorway.x._uri import uri_parse
30-
from doorway.x._uri import uri_validate
31-
32-
3327
# ========================================================================= #
3428
# TEST UTILS #
3529
# ========================================================================= #
3630

3731

32+
@pytest.mark.extra_test
3833
def test_uri_type_enum():
34+
from doorway.x._uri import UriTypeEnum
35+
3936
assert len(UriTypeEnum) == 4
4037
assert list(UriTypeEnum) == [
4138
UriTypeEnum.FILE,
@@ -65,7 +62,11 @@ def test_uri_type_enum():
6562
assert UriTypeEnum.URL.name == UriTypeEnum.URL.value
6663

6764

65+
@pytest.mark.extra_test
6866
def test_filename_from_uri():
67+
from doorway.x._uri import UriMalformedException
68+
from doorway.x._uri import uri_validate
69+
6970
# test paths
7071
uri_validate("basename")
7172
uri_validate("basename.ext")
@@ -116,7 +117,10 @@ def test_filename_from_uri():
116117
uri_validate("http://basename.ext/suffix#fragment?query")
117118

118119

120+
@pytest.mark.extra_test
119121
def test_uri_paths_alt():
122+
from doorway.x._uri import uri_parse
123+
120124
def uri(inp, targ=None):
121125
targ = inp if (targ is None) else targ
122126
assert uri_parse(inp).geturl() == targ

0 commit comments

Comments
 (0)