Skip to content

Navigation Menu

Sign in
Appearance settings
Sign up
Appearance settings

Commit 4594665

Browse filesBrowse the repository at this point in the historyBrowse files
committed
added github action job for unit test check
1 parent 5d027f3 commit 4594665
Copy full SHA for 4594665

3 files changed

+19-9Lines changed: 19 additions & 9 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/main.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/main.yml
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
if: failure()
2929
run: git diff
3030

31+
- name: Unit Tests
32+
run: |
33+
python -m pip install pytest
34+
py.test tests -v
35+
3136
- name: Build Package
3237
if: matrix.python-version == '3.7' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
3338
run: |
Collapse file

‎tests/conftest.py‎

Copy file name to clipboardExpand all lines: tests/conftest.py
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from ruamel.yaml import safe_load
2-
import pytest
31
import os
42

3+
import pytest
4+
from ruamel.yaml import safe_load
5+
56
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
67

78

@@ -20,16 +21,16 @@ def sources(request):
2021
"file": [os.path.join(BASE_DIR, "data", "text_file")],
2122
"files": [
2223
os.path.join(BASE_DIR, "data", "text_file"),
23-
os.path.join(BASE_DIR, "data", "recursive", "recursive_text_file.txt")
24+
os.path.join(BASE_DIR, "data", "recursive", "recursive_text_file.txt"),
2425
],
2526
"directory": [os.path.join(BASE_DIR, "data")],
2627
"directories": [
2728
os.path.join(BASE_DIR, "data"),
28-
os.path.join(BASE_DIR, "data", "recursive")
29+
os.path.join(BASE_DIR, "data", "recursive"),
2930
],
3031
"file-directory": [
3132
os.path.join(BASE_DIR, "data", "text_file"),
32-
os.path.join(BASE_DIR, "data")
33-
]
33+
os.path.join(BASE_DIR, "data"),
34+
],
3435
}
3536
return SOURCES_TYPE[request.param]
Collapse file

‎tests/test_methods.py‎

Copy file name to clipboardExpand all lines: tests/test_methods.py
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import pytest
21
import os
32

3+
import pytest
4+
45
from linkstatus.linkstatus import all_files
56

67

@@ -18,8 +19,11 @@ def test_all_files(sources, recursive):
1819

1920
if recursive:
2021
for d in [d for d in inside_entities if os.path.isdir(d) and "__" not in d]:
21-
files = [os.path.join(d, f) for f in os.listdir(d) if os.path.isfile(
22-
os.path.join(d, f))]
22+
files = [
23+
os.path.join(d, f)
24+
for f in os.listdir(d)
25+
if os.path.isfile(os.path.join(d, f))
26+
]
2327
inside_files.extend(files)
2428
expected_files.extend(inside_files)
2529

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.