annotate tests/_test_context.py @ 737:282c8e64d7b1

FIX: tests on non-Windows
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 29 Oct 2023 11:32:56 +0100
parents 75ecbe07abff
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
619
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
2 r"""Automatic unittest context configuration
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
3
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
4 """
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
5
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
6 import sys
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
7 import os
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
8
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
9 sys.path.insert(
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
10 0,
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
11 os.path.abspath(
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
12 os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))))
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
13
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
14
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
15 TESTDATADIR = os.path.join(
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
16 os.path.abspath(os.path.dirname(__file__)),
75ecbe07abff Introduct a test context to more easily switch between some unittest configurations
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
diff changeset
17 "data")