Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
54f2c5bf
Commit
54f2c5bf
authored
Jan 09, 2017
by
Daniel Brown
Browse files
making test scripts raise exception on warning
parent
def5b19e
Pipeline
#1773
passed with stage
in 19 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pykat/finesse.py
View file @
54f2c5bf
...
...
@@ -878,6 +878,7 @@ class kat(object):
self
.
__time_code
=
None
self
.
__yaxis
=
"abs"
# default yaxis
self
.
__lambda0
=
1064e-9
self
.
__finesse_dir
=
None
if
kat_code
!=
None
and
kat_file
!=
None
:
raise
pkex
.
BasePyKatException
(
"Specify either a Kat file or some Kat code, not both."
)
...
...
@@ -895,7 +896,7 @@ class kat(object):
def
__setattr__
(
self
,
name
,
value
):
if
"____FROZEN____"
in
self
.
__dict__
and
self
.
__dict__
[
"____FROZEN____"
]
and
not
hasattr
(
self
,
name
):
warnings
.
warn
(
"'%s' does not have attribute called '%s'"
%
(
self
.
__name
,
name
),
stacklevel
=
2
)
warnings
.
warn
(
"'%s' does not have attribute called '%s'"
%
(
self
.
__
class__
.
__
name
__
,
name
),
stacklevel
=
2
)
super
(
kat
,
self
).
__setattr__
(
name
,
value
)
...
...
test/run_tests.py
View file @
54f2c5bf
...
...
@@ -2,6 +2,9 @@ import pykat
import
traceback
import
os
import
sys
import
warnings
warnings
.
filterwarnings
(
'error'
)
class
bcolors
:
HEADER
=
'
\033
[95m'
...
...
test/test_scripts/structural/test_deepcopying_references.py
View file @
54f2c5bf
...
...
@@ -44,7 +44,7 @@ kat1.o1.num_demods = 2
assert
(
hasattr
(
kat1
.
o1
,
"f2"
))
assert
(
not
hasattr
(
kat0
.
o1
,
"f2"
))
kat1
.
num_demods
=
1
kat1
.
o1
.
num_demods
=
1
assert
(
hasattr
(
kat1
.
o1
,
"f1"
))
...
...
test/test_scripts/structural/test_lambda0_beam_param.py
View file @
54f2c5bf
...
...
@@ -26,7 +26,7 @@ yaxis abs:deg # move detector frequency with xax
kat
=
finesse
.
kat
()
kat
.
verbose
=
False
kat
.
lambda0
=
1550e-9
kat
.
parse
KatCode
(
kat_code
)
kat
.
parse
Commands
(
kat_code
)
kat
.
maxtem
=
0
kat
.
trace
=
2
out
,
T
=
kat
.
run
(
getTraceData
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment