mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-12-22 18:50:43 -06:00
18 lines
335 B
Python
18 lines
335 B
Python
|
import sys
|
||
|
|
||
|
import pytest
|
||
|
from viv import use
|
||
|
|
||
|
|
||
|
def test_use():
|
||
|
with pytest.raises(ImportError):
|
||
|
import pyjokes # noqa
|
||
|
|
||
|
use("pyjokes")
|
||
|
import pyjokes # noqa
|
||
|
|
||
|
with pytest.raises(ImportError):
|
||
|
from sample.simple import add_one # noqa
|
||
|
|
||
|
assert len([p for p in sys.path if "site-packages" in p]) == 1
|