Skip to content

Commit

Permalink
fix pytest issies reported in tomerfiliba-org#544
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Kłoczko <[email protected]>
  • Loading branch information
kloczek committed May 17, 2024
1 parent 0194cbd commit 5e4c31c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/test_affinity.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import time
import unittest
import support
from tests import support
import rpyc


Expand Down
2 changes: 1 addition & 1 deletion tests/test_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def tearDown(self):
self.conn.close()

def test_properties(self):
p = self.conn.modules["test_attributes"].Properties()
p = self.conn.modules["tests.test_attributes"].Properties()
print(p.counter) # 1
print(p.counter) # 2
print(p.counter) # 3
Expand Down
2 changes: 1 addition & 1 deletion tests/test_classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_mock_connection(self):
self.assertEqual(conn.eval("2+3"), 5)

def test_modules(self):
self.assertIn('test_magic', self.conn.modules)
self.assertIn('tests.test_magic', self.conn.modules)
self.assertNotIn('test_badmagic', self.conn.modules)
self.assertIsNone(self.conn.builtins.locals()['self']._last_traceback)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def tearDown(self):

def test_hash_class(self):
hesh = self.conn.builtins.hash
mod = self.conn.modules.test_magic
mod = self.conn.modules.tests.test_magic
self.assertEqual(hash(mod.Base), 4321)
self.assertEqual(hash(mod.Foo), 4321)
self.assertEqual(hash(mod.Bar), 4321)
Expand All @@ -53,7 +53,7 @@ def test_hash_class(self):

def test_hash_obj(self):
hesh = self.conn.builtins.hash
mod = self.conn.modules.test_magic
mod = self.conn.modules.tests.test_magic
obj = mod.Base()

self.assertNotEqual(hash(obj), 1234)
Expand Down
16 changes: 8 additions & 8 deletions tests/test_netref_hierachy.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ def tearDown(self):

def test_instancecheck_across_connections(self):
self.conn2 = rpyc.classic.connect('localhost', port=18878)
self.conn.execute('import test_magic')
self.conn2.execute('import test_magic')
foo = self.conn.modules.test_magic.Foo()
bar = self.conn.modules.test_magic.Bar()
self.assertTrue(isinstance(foo, self.conn.modules.test_magic.Foo))
self.assertTrue(isinstance(bar, self.conn2.modules.test_magic.Bar))
self.assertFalse(isinstance(bar, self.conn.modules.test_magic.Foo))
self.conn.execute('import tests.test_magic')
self.conn2.execute('import tests.test_magic')
foo = self.conn.modules.tests.test_magic.Foo()
bar = self.conn.modules.tests.test_magic.Bar()
self.assertTrue(isinstance(foo, self.conn.modules.tests.test_magic.Foo))
self.assertTrue(isinstance(bar, self.conn2.modules.tests.test_magic.Bar))
self.assertFalse(isinstance(bar, self.conn.modules.tests.test_magic.Foo))
with self.assertRaises(TypeError):
isinstance(self.conn.modules.test_magic.Foo, bar)
isinstance(self.conn.modules.tests.test_magic.Foo, bar)

def test_classic(self):
x = self.conn.builtin.list((1, 2, 3, 4))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_service_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import timeit
import rpyc
import unittest
import cfg_tests
from tests import cfg_tests
try:
import pandas as pd
import numpy as np
Expand Down

0 comments on commit 5e4c31c

Please sign in to comment.