From 0deb462c6a6db4e1b28f6219af0349309567aa62 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Dec 2018 10:48:57 +0100 Subject: [PATCH] move path manipulation into single module Change-Id: If88aafd03b757715b82cd733b3155e656c252b06 Reviewed-on: https://forge.frm2.tum.de/review/19529 Tested-by: JenkinsCodeReview Reviewed-by: Enrico Faulhaber --- test/__init__.py | 4 ++++ test/test_client_baseclient.py | 4 ---- test/test_datatypes.py | 5 ----- test/test_lib_enum.py | 5 ----- test/test_modules.py | 5 ----- test/test_params.py | 5 ----- test/test_parse.py | 4 ---- 7 files changed, 4 insertions(+), 28 deletions(-) create mode 100644 test/__init__.py diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..32c59be --- /dev/null +++ b/test/__init__.py @@ -0,0 +1,4 @@ +import sys +from os import path + +sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..'))) diff --git a/test/test_client_baseclient.py b/test/test_client_baseclient.py index ffa9302..02775cc 100644 --- a/test/test_client_baseclient.py +++ b/test/test_client_baseclient.py @@ -22,14 +22,10 @@ """test base client.""" from __future__ import division, print_function -import sys from collections import OrderedDict -from os import path import pytest -sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..'))) - from secop.client.baseclient import Client diff --git a/test/test_datatypes.py b/test/test_datatypes.py index d9dcfc3..52be19f 100644 --- a/test/test_datatypes.py +++ b/test/test_datatypes.py @@ -23,14 +23,9 @@ from __future__ import division, print_function -import sys -from os import path - # no fixtures needed import pytest -sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..'))) - from secop.datatypes import (ArrayOf, BLOBType, BoolType, DataType, EnumType, FloatRange, IntRange, ProgrammingError, StringType, StructOf, TupleOf, get_datatype) diff --git a/test/test_lib_enum.py b/test/test_lib_enum.py index eb7897f..78ab40a 100644 --- a/test/test_lib_enum.py +++ b/test/test_lib_enum.py @@ -23,14 +23,9 @@ from __future__ import division, print_function -import sys -from os import path - # no fixtures needed import pytest -sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..'))) - from secop.lib.enum import Enum, EnumMember diff --git a/test/test_modules.py b/test/test_modules.py index 3f33020..1384626 100644 --- a/test/test_modules.py +++ b/test/test_modules.py @@ -22,14 +22,9 @@ """test data types.""" from __future__ import division, print_function -import sys -from os import path - # no fixtures needed import pytest -sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..'))) - from secop.datatypes import BoolType, EnumType from secop.metaclass import ModuleMeta from secop.modules import Communicator, Drivable, Module, Readable, Writable diff --git a/test/test_params.py b/test/test_params.py index dc064fc..fef4fc0 100644 --- a/test/test_params.py +++ b/test/test_params.py @@ -23,14 +23,9 @@ from __future__ import division, print_function -import sys -from os import path - # no fixtures needed import pytest -sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..'))) - from secop.datatypes import BoolType from secop.params import Command, Override, Parameter diff --git a/test/test_parse.py b/test/test_parse.py index 0a5fcdb..273c0f0 100644 --- a/test/test_parse.py +++ b/test/test_parse.py @@ -23,14 +23,10 @@ from __future__ import division, print_function -import sys from collections import OrderedDict -from os import path import pytest -sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..'))) - from secop.parse import Parser