回答編集履歴
2
自分でスクリプトを書いたのでそれに関して追記
test
CHANGED
@@ -17,3 +17,19 @@
|
|
17
17
|
各モジュールにsys.path.appendを入れるのはやっぱり面倒なので、以下モジュールを作ってテストディレクトリ以下に入れて使うのが良さそうですね。
|
18
18
|
|
19
19
|
[import from parent directory | Python Adventures](https://pythonadventures.wordpress.com/tag/import-from-parent-directory/)
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
# 2016/3/7 18:21 追記
|
24
|
+
|
25
|
+
拙いながらこんなモジュールを書きました。
|
26
|
+
|
27
|
+
コレをテストコードのディレクトリに置いてimport_my_moduleメソッドでPYTHONPATHにパスを追加することで、理想通りテストが動くようになりました。
|
28
|
+
|
29
|
+
[This file deploy your script directory. Then your make module import easly maybe.](https://gist.github.com/manzyun/9623831c04afb95b274e)
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
また、confのエラーに関しては相対インポートを使ってインポートさせるようにして動作させました。
|
34
|
+
|
35
|
+
[6. モジュール (module) — Python 3.5.1 ドキュメント](http://docs.python.jp/3.5/tutorial/modules.html#intra-package-references)
|
1
昨日見つけたモジュールの追記
test
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# 2016/3/7 午前中
|
2
|
+
|
1
3
|
すみません、自己解決(?)しました。
|
2
4
|
|
3
5
|
|
@@ -7,3 +9,11 @@
|
|
7
9
|
|
8
10
|
|
9
11
|
ただ、この解法、個人的にはクールじゃないなあと思っているのですが、僕の能力ではこれ以上考えても埒が明かないので、この方法でテストを継続しようと思います。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
# 2016/3/7 15:33 追記
|
16
|
+
|
17
|
+
各モジュールにsys.path.appendを入れるのはやっぱり面倒なので、以下モジュールを作ってテストディレクトリ以下に入れて使うのが良さそうですね。
|
18
|
+
|
19
|
+
[import from parent directory | Python Adventures](https://pythonadventures.wordpress.com/tag/import-from-parent-directory/)
|