Skip to content

Commit e978ea7

Browse files
authored
Vg test branch (RaduG#4)
* Add tests for is_package
1 parent d3c13c5 commit e978ea7

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Publish
22
on:
33
release:
4-
types: [created]
4+
types: [published]
55
jobs:
66
deploy:
77
runs-on: ubuntu-latest

setup.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
import os
12
from setuptools import setup
23

4+
5+
this_directory = os.path.abspath(os.path.dirname(__file__))
6+
with open(os.path.join(this_directory, 'README.md'), "r") as f:
7+
long_description = f.read()
8+
9+
310
setup(
411
name="pytest_func_cov",
512
packages=["pytest_func_cov"],
6-
version="0.1.2",
13+
version="0.1.3",
714
license="MIT",
815
description="Pytest plugin for measuring function coverage",
16+
long_description=long_description,
17+
long_description_content_type='text/markdown',
918
author="Radu Ghitescu",
1019
author_email="radu.ghitescu@gmail.com",
1120
url="https://github.com/radug0314/pytest_func_cov",

tests/test_non_package/.placeholder

Whitespace-only changes.

tests/test_tracking.py

+20
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from .test_package import classes, functions
66

7+
import os
8+
79

810
@pytest.mark.parametrize(
911
"func",
@@ -20,3 +22,21 @@ def test_get_full_function_name_correct_for_simple_function(func):
2022
expected_name = f"{func.__module__}.{func.__qualname__}"
2123

2224
assert tracking.get_full_function_name(func) == expected_name
25+
26+
@pytest.fixture
27+
def package_path():
28+
return os.path.dirname(os.path.abspath(__file__))
29+
30+
@pytest.fixture
31+
def non_package_path():
32+
return os.path.dirname(os.path.abspath(__file__)) + "/test_non_package/"
33+
34+
def test_is_package_with_package(package_path):
35+
expected_result = tracking.is_package(package_path)
36+
37+
assert expected_result
38+
39+
def test_is_package_with_non_package(non_package_path):
40+
expected_result = tracking.is_package(non_package_path)
41+
42+
assert not expected_result

0 commit comments

Comments
 (0)