From 4314fed87ff39c16ecab6d4560ed29f230634603 Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Mon, 11 Dec 2023 07:55:32 +0100 Subject: [PATCH] Change test folder to package to allow relative imports (#204) --- tests/__init__.py | 8 ++++++++ tests/test_examples.py | 4 ++-- tests/test_grammars.py | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..9f22add --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,8 @@ +# Copyright (c) 2023 Renata Hodovan, Akos Kiss. +# +# Licensed under the BSD 3-Clause License +# . +# This file may not be copied, modified, or distributed except +# according to those terms. + +# INTENTIONALLY EMPTY diff --git a/tests/test_examples.py b/tests/test_examples.py index f40b0a9..028d2dd 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Renata Hodovan, Akos Kiss. +# Copyright (c) 2017-2023 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # . @@ -8,7 +8,7 @@ import os import pytest -from run_grammars import collect_grammar_commands, run_grammar +from .run_grammars import collect_grammar_commands, run_grammar grammars_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'examples', 'grammars') diff --git a/tests/test_grammars.py b/tests/test_grammars.py index 864e28c..7751bd2 100644 --- a/tests/test_grammars.py +++ b/tests/test_grammars.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Renata Hodovan, Akos Kiss. +# Copyright (c) 2017-2023 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # . @@ -8,7 +8,7 @@ import os import pytest -from run_grammars import collect_grammar_commands, run_grammar +from .run_grammars import collect_grammar_commands, run_grammar grammars_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'grammars')