Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pytest issues reported in #544 #557

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading