from nose.tools import assert_in, assert_equal
from bluesky.run_engine import RunEngine
from bluesky.tests.utils import setup_test_run_engine
from bluesky.examples import simple_scan, motor


RE = setup_test_run_engine()


def test_custom_metadata():
    def assert_lion(name, doc):
        assert_in('animal', doc)
        assert_equal(doc['animal'], 'lion')

    RE(simple_scan(motor), animal='lion', subs={'start': assert_lion})
    # Note: Because assert_lion is processed on the main thread, it can
    # fail the test. I checked by writing a failing version of it.  - D.A.

@@ -1,51 +1,4 @@
-from nose.tools import assert_in, assert_equal%0A
 from
@@ -247,20 +247,17 @@
 sert
-_in(
+ 
 'animal'
 , do
@@ -252,22 +252,23 @@
 'animal'
-,
+ in
  doc
-)
 %0A       
@@ -278,15 +278,9 @@
 sert
-_equal(
+ 
 doc%5B
@@ -292,17 +292,18 @@
 al'%5D
-,
+ ==
  'lion'
-)
 %0A%0A  

Remove nose from test_documents