[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: updating mechanize - help concerning tests with pybuild



Dear Dmitry

thanks for your email!

On Sat, 31 Aug 2019, Dmitry Shachnev wrote:
> - Add run_tests.py and the tests themselves to debian/pybuild.testfiles,
>   to make pybuild copy them to the build directory.
> 
> - Add override_dh_auto_test target with a command like this:
>   dh_auto_test -- --system custom --test-args "{interpreter} run_tests.py"

Ok, I have done this and added the necessary files. Interestingly, I
*still* get errors:

Testing manually in the root:
$ pwd
.../mechanize.git
$ ls
... examples mechanize test test-tools ...
$ python2.7 run_tests.py
...............................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 303 tests in 6.048s

OK


Testing manually in the build directory 
$ pwd
.../mechanize.git/.pybuild/cpython2_2.7_mechanize/build
$ ls
... examples mechanize test test-tools ...
$ python2.7 run_tests.py 
...............................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 303 tests in 5.960s

OK


Finally doing dpkg-buildpackage or whatever
   debian/rules override_dh_auto_test-indep
make[1]: Entering directory '/home/norbert/Development/calibre/mechanize.git'
dh_auto_test -- --system custom --test-args "{interpreter} run_tests.py"
	pybuild --test -i python{version} -p 2.7 --system custom --test-args "{interpreter} run_tests.py"
I: pybuild base:217: python2.7 run_tests.py
.................................................................................................................................................................E...EEEEEEE.EEF.E.EEE.EE.EEEEEEEEEE..................................................................................FF.......................


Now, the interesting thing are the error messages. One of them is

ERROR: test_mozilla_cookiejar (test.test_functional.CookieJarTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/norbert/Development/calibre/mechanize.git/test/test_functional.py", line 684, in test_mozilla_cookiejar
    self._test_cookiejar(make_cookiejar, commit)
  File "/home/norbert/Development/calibre/mechanize.git/test/test_functional.py", line 654, in _test_cookiejar
    html = br.open(url).read()
  File "/home/norbert/Development/calibre/mechanize.git/mechanize/_mechanize.py", line 253, in open
    return self._mech_open(url_or_request, data, timeout=timeout)
  File "/home/norbert/Development/calibre/mechanize.git/mechanize/_mechanize.py", line 309, in _mech_open
    raise response
httperror_seek_wrapper: HTTP Error 403: request disallowed by robots.txt


Huuuu? Why does it use the original file directly in mechanize.git???

run_tests.py does more or less
    this_dir = os.path.dirname(__file__)
    sys.path.insert(0, os.path.join(this_dir, "test"))
    sys.path.insert(0, os.path.join(this_dir, "test-tools"))
    sys.path.insert(0, os.path.join(this_dir, "mechanize"))
so **why** does it use the test/test-tools/mechanize from the ROOT
instead of the python test build?

It seems something is messed up in the pybuild test setup?

If you want to take a look, here is the git repo with the current
status:
	https://github.com/norbusan/debian-mechanize.git

Thanks a lot and all the best

Norbert

--
PREINING Norbert                               http://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13


Reply to: