File: README_NO_INIT_PY

package info (click to toggle)
python-autobahn 22.7.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,404 kB
  • sloc: python: 38,356; javascript: 2,705; makefile: 905; ansic: 371; sh: 63
file content (26 lines) | stat: -rw-r--r-- 951 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
**DO NOT ADD a __init__.py file in this directory**

"Why not?" you ask; read on!

1. If we're running asyncio tests, we can't ever call txaio.use_twisted()

2. If we're running twisted tests, we can't ever call txaio.use_asycnio()...

3. ...and these are decided/called at import time

4. so: we can't *import* any of the autobahn.asyncio.* modules if we're
   running twisted tests (or vice versa)

5. ...but test-runners (py.test and trial) import things automagically
   (to "discover" tests)

6. We use py.test to run asyncio tests; see "setup.cfg" where we tell
   it "norecursedirs = autobahn/twisted/*" so it doesn't ipmort twisted
   stuff (and hence call txaio.use_twisted())

7. We use trial to run twisted tests; the lack of __init__ in here
   stops it from trying to import this (and hence the parent
   package). (The only files matching test_*.py are in this
   directory.)

*Therefore*, we don't put a __init__ file in this directory.