aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2021-01-14 17:05:14 +0000
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2021-01-14 17:05:14 +0000
commit9a12299a04bac0f21dca32f9cea01f420a4a86ec (patch)
tree1a8d3f5f51b9bd67d68041213b02657e341f7904
parentcode formatting (diff)
downloadSyncRNG-9a12299a04bac0f21dca32f9cea01f420a4a86ec.tar.gz
SyncRNG-9a12299a04bac0f21dca32f9cea01f420a4a86ec.zip
robustify test
-rw-r--r--tests/test.py8
1 files 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())