From d48cb34e566c4a8c4d487fe0444a327008412ec0 Mon Sep 17 00:00:00 2001 From: Ashok B Date: Fri, 14 Jan 2022 23:04:17 +0530 Subject: [PATCH 1/4] refactored using __init__ and class import for #83 --- tests/__init__.py | 0 tests/test_basics.py | 18 ++++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_basics.py b/tests/test_basics.py index b432c38..ccd357b 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -1,14 +1,16 @@ -import os -import sys -relpath = os.path.dirname(__file__) # Find relative path: from current directory to test.py -abspath = os.path.abspath(".") # Find absolute path: from / to current directory -os.chdir(abspath + '/first_timers') -sys.path.append('./') -import first_timers +# import os +# import sys +# relpath = os.path.dirname(__file__) # Find relative path: from current directory to test.py +# abspath = os.path.abspath(".") # Find absolute path: from / to current directory +# os.chdir(abspath + '/first_timers') +# sys.path.append('./') + +# attribution: https://containersolutions.github.io/runbooks/posts/python/module-has-no-attribute/#step-2 +from first_timers import first_timers import json -example_res = json.load(open('../data/example.json', 'r')) +example_res = json.load(open('data/example.json', 'r')) example_issues = example_res['items'] From 83cf09c006fef371a94ad1ace6be8c5db44a86cf Mon Sep 17 00:00:00 2001 From: Ashok B Date: Sat, 15 Jan 2022 01:09:39 +0530 Subject: [PATCH 2/4] sample file for now --- conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..87decc2 --- /dev/null +++ b/conftest.py @@ -0,0 +1,8 @@ +''' +import pytest + +@pytest.fixture +def input_value(): + input = 39 + return input +''' \ No newline at end of file From b82047f3e22600b386ff5be41b89782c22219c16 Mon Sep 17 00:00:00 2001 From: Ashok B Date: Sat, 15 Jan 2022 03:04:54 +0530 Subject: [PATCH 3/4] added simple make targets --- Makefile | 15 +++++++++++++++ conftest.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0bd1caa --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ + +.PHONY: clean-pyc init lint test + +lint: + flake8 --exclude=.tox + +#init: +# pip install -r requirements.txt + +test: + pytest --verbose --color=yes $(TEST_PATH) + +clean-pyc: + echo "Cleaning, TBD" + diff --git a/conftest.py b/conftest.py index 87decc2..eb707b2 100644 --- a/conftest.py +++ b/conftest.py @@ -5,4 +5,4 @@ def input_value(): input = 39 return input -''' \ No newline at end of file +''' From 07f2262621975536dd056d37a4047015b40f94a5 Mon Sep 17 00:00:00 2001 From: Ashok B Date: Sat, 15 Jan 2022 12:38:02 +0530 Subject: [PATCH 4/4] comments cleanup --- tests/{test_basics.py => test_basic.py} | 6 ------ 1 file changed, 6 deletions(-) rename tests/{test_basics.py => test_basic.py} (77%) diff --git a/tests/test_basics.py b/tests/test_basic.py similarity index 77% rename from tests/test_basics.py rename to tests/test_basic.py index ccd357b..ebdb681 100644 --- a/tests/test_basics.py +++ b/tests/test_basic.py @@ -1,9 +1,3 @@ -# import os -# import sys -# relpath = os.path.dirname(__file__) # Find relative path: from current directory to test.py -# abspath = os.path.abspath(".") # Find absolute path: from / to current directory -# os.chdir(abspath + '/first_timers') -# sys.path.append('./') # attribution: https://containersolutions.github.io/runbooks/posts/python/module-has-no-attribute/#step-2 from first_timers import first_timers