Skip to content

Commit dd7738d

Browse files
authored
Don't remove basilisp.core in tests (#212)
1 parent ee0750a commit dd7738d

File tree

4 files changed

+4
-30
lines changed

4 files changed

+4
-30
lines changed

tests/basilisp/compiler_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import basilisp.lang.symbol as sym
1919
import basilisp.lang.vector as vec
2020
import basilisp.reader as reader
21-
from basilisp.lang.runtime import Namespace, Var
21+
from basilisp.lang.runtime import Var
2222
from basilisp.main import init
2323
from basilisp.util import Maybe
2424

@@ -48,7 +48,6 @@ def test_ns() -> str:
4848
def ns_var(test_ns: str):
4949
runtime.init_ns_var(which_ns=runtime._CORE_NS)
5050
yield runtime.set_current_ns(test_ns)
51-
Namespace.remove(sym.symbol(runtime._CORE_NS))
5251

5352

5453
@pytest.fixture
@@ -682,7 +681,7 @@ def test_unquote(ns_var: Var):
682681

683682

684683
def test_unquote_splicing(ns_var: Var, resolver: reader.Resolver):
685-
with pytest.raises(runtime.RuntimeException):
684+
with pytest.raises(TypeError):
686685
lcompile("~@[1 2 3]")
687686

688687
assert llist.l(1, 2, 3) == lcompile("`(~@[1 2 3])")

tests/basilisp/namespace_test.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ def test_create_ns(ns_sym: sym.Symbol, ns_cache: patch):
4646

4747

4848
@pytest.fixture
49-
def ns_cache_with_existing_ns(ns_sym: sym.Symbol,
50-
core_ns_sym: sym.Symbol,
49+
def ns_cache_with_existing_ns(ns_sym: sym.Symbol, core_ns_sym: sym.Symbol,
5150
core_ns: Namespace) -> patch:
5251
"""Patch the Namespace cache with a test fixture with an existing namespace."""
5352
return patch('basilisp.lang.runtime.Namespace._NAMESPACES',
@@ -68,26 +67,6 @@ def test_get_existing_ns(ns_sym: sym.Symbol,
6867
assert len(cache.deref().keys()) == 2
6968

7069

71-
def test_get_existing_ns_with_get(ns_sym: sym.Symbol,
72-
ns_cache_with_existing_ns: patch):
73-
with ns_cache_with_existing_ns as cache:
74-
assert len(cache.deref().keys()) == 2
75-
ns = Namespace.get(ns_sym)
76-
assert isinstance(ns, Namespace)
77-
assert ns.name == ns_sym.name
78-
assert len(cache.deref().keys()) == 2
79-
80-
81-
def test_get_nil_for_non_existent_ns(ns_sym: sym.Symbol):
82-
with patch('basilisp.lang.runtime.Namespace._NAMESPACES',
83-
atom.Atom(
84-
lmap.map({}))) as cache:
85-
assert len(cache.deref().keys()) == 0
86-
ns = Namespace.get(ns_sym)
87-
assert ns is None
88-
assert len(cache.deref().keys()) == 0
89-
90-
9170
def test_remove_ns(ns_sym: sym.Symbol, ns_cache_with_existing_ns: patch):
9271
with ns_cache_with_existing_ns as cache:
9372
assert len(cache.deref().keys()) == 2
@@ -193,8 +172,6 @@ def other_ns(core_map: sym.Symbol,
193172

194173
yield runtime.set_current_ns(test_ns).value
195174

196-
Namespace.remove(sym.symbol(runtime._CORE_NS))
197-
198175

199176
def test_refer_core(core_ns_sym: sym.Symbol,
200177
other_ns: Namespace,

tests/basilisp/reader_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import basilisp.lang.util as langutil
1212
import basilisp.lang.vector as vec
1313
import basilisp.reader as reader
14-
from basilisp.lang.runtime import Namespace, Var
14+
from basilisp.lang.runtime import Var
1515

1616

1717
@pytest.fixture
@@ -23,7 +23,6 @@ def test_ns() -> str:
2323
def ns_var(test_ns: str):
2424
runtime.init_ns_var(which_ns=runtime._CORE_NS)
2525
yield runtime.set_current_ns(test_ns)
26-
Namespace.remove(sym.symbol(runtime._CORE_NS))
2726

2827

2928
def read_str_first(s, resolver: reader.Resolver = None, data_readers=None):

tests/basilisp/runtime_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ def test_trampoline_args():
252252
def core_ns():
253253
ns_var = runtime.init_ns_var(which_ns=runtime._CORE_NS)
254254
yield ns_var.value
255-
runtime.Namespace.remove(sym.symbol(runtime._CORE_NS))
256255

257256

258257
def test_resolve_alias(core_ns):

0 commit comments

Comments
 (0)