test_refs.py 872 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. """Some simple tests for the plugin while running scripts.
  2. """
  3. # Module imports
  4. # Std lib
  5. import inspect
  6. # Our own
  7. #-----------------------------------------------------------------------------
  8. # Testing functions
  9. def test_trivial():
  10. """A trivial passing test."""
  11. pass
  12. def doctest_run():
  13. """Test running a trivial script.
  14. In [13]: run simplevars.py
  15. x is: 1
  16. """
  17. def doctest_runvars():
  18. """Test that variables defined in scripts get loaded correcly via %run.
  19. In [13]: run simplevars.py
  20. x is: 1
  21. In [14]: x
  22. Out[14]: 1
  23. """
  24. def doctest_ivars():
  25. """Test that variables defined interactively are picked up.
  26. In [5]: zz=1
  27. In [6]: zz
  28. Out[6]: 1
  29. """
  30. def doctest_refs():
  31. """DocTest reference holding issues when running scripts.
  32. In [32]: run show_refs.py
  33. c referrers: [<... 'dict'>]
  34. """