From 9a12299a04bac0f21dca32f9cea01f420a4a86ec Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 14 Jan 2021 17:05:14 +0000 Subject: robustify test --- tests/test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test.py b/tests/test.py index d217f80..58b504d 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- - +import os import unittest from SyncRNG import SyncRNG @@ -39,7 +39,11 @@ class SyncRNGTestCase(unittest.TestCase): def test_first_1000(self): s = SyncRNG(seed=0) - with open("./test/first_1000_seed_0.txt", "r") as fid: + + here = os.path.dirname(__file__) + test_file = os.path.join(here, "first_1000_seed_0.txt") + + with open(test_file, "r") as fid: for line in fid: exp = int(line.strip()) self.assertTrue(exp == s.randi()) -- cgit v1.2.3