@@ -30,19 +30,7 @@ def test_image_entrypoint_starts(self, image: str, sysctls) -> None:
30
30
skip_if_not_workbench_image (image )
31
31
32
32
container = WorkbenchContainer (image = image , user = 1000 , group_add = [0 ],
33
- sysctls = sysctls ,
34
- # because rstudio only prints out errors when TTY is present
35
- # > TTY detected. Printing informational message about logging configuration.
36
- tty = True ,
37
- # another rstudio speciality, without this, it gives
38
- # > system error 13 (Permission denied) [path: /opt/app-root/src/.cache/rstudio
39
- # equivalent podman command may include
40
- # > --mount type=tmpfs,dst=/opt/app-root/src,notmpcopyup
41
- # can't use mounts= because testcontainers already sets volumes=
42
- # > mounts=[docker.types.Mount(target="/opt/app-root/src/", source="", type="volume", no_copy=True)],
43
- # can use tmpfs=, keep in mind `notmpcopyup` opt is podman specific
44
- tmpfs = {"/opt/app-root/src" : "rw,notmpcopyup" },
45
- )
33
+ sysctls = sysctls )
46
34
try :
47
35
try :
48
36
container .start ()
@@ -64,7 +52,22 @@ def __init__(
64
52
port : int = 8888 ,
65
53
** kwargs ,
66
54
) -> None :
67
- super ().__init__ (** kwargs )
55
+ defaults = dict (
56
+ # because rstudio only prints out errors when TTY is present
57
+ # > TTY detected. Printing informational message about logging configuration.
58
+ tty = True ,
59
+ # another rstudio speciality, without this, it gives
60
+ # > system error 13 (Permission denied) [path: /opt/app-root/src/.cache/rstudio
61
+ # equivalent podman command may include
62
+ # > --mount type=tmpfs,dst=/opt/app-root/src,notmpcopyup
63
+ # can't use mounts= because testcontainers already sets volumes=
64
+ # > mounts=[docker.types.Mount(target="/opt/app-root/src/", source="", type="volume", no_copy=True)],
65
+ # can use tmpfs=, keep in mind `notmpcopyup` opt is podman specific
66
+ tmpfs = {"/opt/app-root/src" : "rw,notmpcopyup" },
67
+ )
68
+ if not kwargs .keys ().isdisjoint (defaults .keys ()):
69
+ raise TypeError (f"Keyword arguments in { defaults .keys ()= } are not allowed, for good reasons" )
70
+ super ().__init__ (** defaults , ** kwargs )
68
71
69
72
self .port = port
70
73
self .with_exposed_ports (self .port )
0 commit comments