From c8884839b72840f65d94efc4471cddad02d81e68 Mon Sep 17 00:00:00 2001 From: mraniki Date: Thu, 27 Apr 2023 23:13:52 +0200 Subject: [PATCH 1/3] Refactor pytest version and add filterwarnings to pytest.ini --- pyproject.toml | 7 ++++++- tests/parsing_test.py.archive | 25 ------------------------- tests/test_unit.py | 4 ---- 3 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 tests/parsing_test.py.archive diff --git a/pyproject.toml b/pyproject.toml index 1c7f49db..ed80f184 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,9 +21,14 @@ pyparsing = ">=3.0.9" [tool.poetry.dev-dependencies] python-semantic-release = "*" -pytest = "*" +pytest = "7.4" pytest-cov = "*" +[pytest] +filterwarnings = + ignore:.*U.*mode is deprecated:DeprecationWarning + + [tool.pytest.ini_options] testpaths = "tests/" python_classes = [ diff --git a/tests/parsing_test.py.archive b/tests/parsing_test.py.archive deleted file mode 100644 index 477a4166..00000000 --- a/tests/parsing_test.py.archive +++ /dev/null @@ -1,25 +0,0 @@ - -from pyparsing import one_of, Word, alphas, Regex, Optional - - - -mystring = "this is a test" - -action = Regex(r'/(SELL|BUY|long|short)/i') -currency_pair = Regex(r'(?<=SELL|BUY|long|short\s).\w+') -stop_loss = Regex(r'sl=(\d+)') -take_profit = Regex(r'tp=(\d+)') -quantity = Regex(r'q=(\d+)') - - -order_grammar = action('action') + currency_pair('currency_pair') \ -+ Optional(stop_loss) + Optional(take_profit) + Optional(quantity) - -# self.logger.debug(f"order_grammar {order_grammar}") -try: - result = order_grammar.parseString(mystring) -except ParseException: - print("none") -# self.logger.debug(f"identify_order result {result}") -print(result) -# return results \ No newline at end of file diff --git a/tests/test_unit.py b/tests/test_unit.py index 4bad7258..9fed1ee4 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -2,10 +2,6 @@ from findmyorder import findmyorder -# def test_dynaconf_is_in_testing_env(): -# assert return_a_value() == "On Testing" - - def test_search(): fmo = findmyorder() print(fmo) From 52e308acacb42db39703db0e2320da554d50dd53 Mon Sep 17 00:00:00 2001 From: mraniki Date: Thu, 27 Apr 2023 23:27:14 +0200 Subject: [PATCH 2/3] fix: Remove deprecated pytest filterwarnings. --- pyproject.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ed80f184..4a6ccf0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,11 +24,6 @@ python-semantic-release = "*" pytest = "7.4" pytest-cov = "*" -[pytest] -filterwarnings = - ignore:.*U.*mode is deprecated:DeprecationWarning - - [tool.pytest.ini_options] testpaths = "tests/" python_classes = [ From a5d863da66fa414a93e940680528b45512cccc7c Mon Sep 17 00:00:00 2001 From: mraniki Date: Thu, 27 Apr 2023 23:28:54 +0200 Subject: [PATCH 3/3] Update pytest version in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4a6ccf0f..1c7f49db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ pyparsing = ">=3.0.9" [tool.poetry.dev-dependencies] python-semantic-release = "*" -pytest = "7.4" +pytest = "*" pytest-cov = "*" [tool.pytest.ini_options]