Newbie questions and suggestions.

65 views
Skip to first unread message

Donovan Baarda

unread,
Oct 15, 2013, 7:42:43 PM10/15/13
to pytho...@googlegroups.com
<me>: G'day everybody, my name is Donovan, I'm a new subscriber.
<everybody>: "hello Donovan"
etc...

I've been out of the Python open-source loop for a bit and just started trying out pythoscope and have a few questions/suggestions.

1) The wiki tutorial on http://pythoscope.org/tutorial seems to be the most extensive source of documentation on Pythoscope... is there any more?

2) By default, the test filename created is tests/test_mymodule.py. I have a long established convention of using tests/mymodule_test.py instead. I discovered by accident that pythoscope will use and update existing tests/mymodule_test.py files if they already exist (nice). Is there a way to tell pythoscope your preferred filename convention for creating new test files? So far I've found just touching the preferred filename before running pythoscope seems to be the only way. Are features like this documented anywhere?

2) The wiki tutorial nicely walks you through creating tests, but doesn't include actually running the tests. What is the current state-of-the-art on running tests, particularly given the import issues for non-installed source;

  a) PYTHONPATH=. tests/mymodule_test.py
  has issues; by default, pythoscope tests are not created executable and don't include a "#!/usr/bin/python" at the start, which means you need to either manually fix them, or run;

  b) PYTHONPATH=. python tests/mymodule_test.py

  c) use some testrunner... what is the currently preferred testrunner that works well with pythoscope tests?

  d) use something like distutils setup.py test... is this what most people use these days?

I think that's it for now... pythoscope looks very nice so far and well done everyone who worked on it.

--

Michał Kwiatkowski

unread,
Oct 21, 2013, 8:24:02 AM10/21/13
to pytho...@googlegroups.com
Hello Donovan!

Thanks for the interest in Pythoscope.

> 1) The wiki tutorial on http://pythoscope.org/tutorial seems to be the
> most extensive source of documentation on Pythoscope... is there any more?

It depends how deep you want to go. There are more doc-like wiki pages, .e.g:

http://pythoscope.org/documentation
http://pythoscope.org/faq

If you're interested in Pythoscope internals, just scroll down to
Development/Architecture/Research Materials on the main page. The
thesis text at the end is probably the most comprehensive, although it
talks specifically about generating tests for programs with side
effects, and not about Pythoscope in general.

And there's also the source code, which is pretty well documented with
docstrings:

https://github.com/mkwiatkowski/pythoscope

> 2) By default, the test filename created is tests/test_mymodule.py.
> I have a long established convention of using tests/mymodule_test.py
> instead. I discovered by accident that pythoscope will use and update
> existing tests/mymodule_test.py files if they already exist (nice). Is
> there a way to tell pythoscope your preferred filename convention for
> creating new test files? So far I've found just touching the preferred
> filename before running pythoscope seems to be the only way. Are
> features like this documented anywhere?

Pythoscope tries to do "the right thing". I don't believe it's
documented anywhere.

The default path name is currently hardcoded here:

https://github.com/mkwiatkowski/pythoscope/blob/master/pythoscope/generator/adder.py#L199

> 2) The wiki tutorial nicely walks you through creating tests, but
> doesn't include actually running the tests. What is the current
> state-of-the-art on running tests, particularly given the import
> issues for non-installed source;

I use nose, which Just Works. ;)

http://nose.readthedocs.org/en/latest/

Simply install and run "nosetests". It will automatically detect and
run all tests it can find.

> I think that's it for now... pythoscope looks very nice so far
> and well done everyone who worked on it.

Thank you. :)

Cheers,
mk
Reply all
Reply to author
Forward
0 new messages